package cn.wiseda.finance.services;

import java.util.List;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import cn.wiseda.finance.dao.BankDao;
import cn.wiseda.finance.entity.Bank;

@Component
@Transactional
public class BankServices {
	private static final Logger log = LoggerFactory.getLogger("BankServices");

	@Resource
	private BankDao bankDao;

	public List<Bank> getBanks() {
		List<Bank> queryBanks = bankDao.queryBanks();
		log.debug("获取银行列表");
		return queryBanks;
	}

	public List<Bank> getBanksByOid(int oid) {
		List<Bank> list = bankDao.queryBankByOid(oid);
		return list;
	}

	public Bank getBank(int id) {
		return bankDao.getBank(id);
	}

	public double sumBankRemarks() {
		return bankDao.sumBankRemarks();
	}

	public double sumBankRemarksByOid(int oid) {
		return bankDao.sumBankRemarksByOid(oid);
	}

	public boolean createBank(Bank bank) {
		return bankDao.createBank(bank);
	}

	public boolean modifyBank(Bank bank) {
		return bankDao.modifyBank(bank);
	}

	public List<Bank> queryBanks(Bank bank) {
		return bankDao.queryBanks(bank);
	}
}
